package cn.com.util;

import org.apache.commons.lang.StringUtils;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;

public class UidUtil {

    public static String createUUID(){
        String s = UUID.randomUUID().toString();
        //去掉"-"符号
        return s.substring(0,8)+s.substring(9,13)+s.substring(14,18)+s.substring(19,23)+s.substring(24);
    }

    public static List<String> splitStringByComma(String idStr){
        if (StringUtils.isBlank(idStr)){
            return new ArrayList<>();
        }
        return Arrays.asList(idStr.split(","));
    }
    public static List<String> splitStringByLine(String idStr){
        if (StringUtils.isBlank(idStr)){
            return new ArrayList<>();
        }
        return Arrays.asList(idStr.split("\\|"));
    }

}
